﻿using Autodesk.AutoCAD.Runtime;
using PublicClass;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace PublicTuKu
{
    /// <summary>
    /// dll入口,命令定义
    /// </summary>
    public class CmdEntry : IExtensionApplication
    {
        /// <summary>
        /// dll加载 走这里
        /// </summary>
        public void Initialize()
        {
            CadUnits.CurEdit().WriteMessage("\n PublicTuKu");
        }
        /// <summary>
        /// dll卸载时处理
        /// </summary>
        public void Terminate()
        {

        } 
        
        // 第四章 图库管理面板
        // QQ群:529711940 大牛,还有gitee代码 不要有中文(命令名称,C#支持中文函数名)
        /// <summary>
        /// 图库管理面板
        /// 1.巩固一下图块和块表记录的概念
        /// 2.巩固一下图块
        /// 3.巩固一下拖动类
        /// 3.如何添加一个面板
        /// </summary>
        [CommandMethod("PublicTuKu_TuKu")]
        public static void PublicTuKu_TuKu()
        {
            TuKuFun.ShowTuKu();
        }

        [CommandMethod("PublicTuKu_TuKuSub")]
        public static void PublicTuKu_TuKuSub()
        {
            if (null != TuKuFun.GetTuKuForm() && !TuKuFun.GetTuKuForm().IsDisposed)
            {
                TuKuFun.GetTuKuForm().InsertBlk();
            }
        }
    }
}
